import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-parent2',
  template: `
    <h2>软件版本</h2>
    <button (click)="newMinor()">最新首版</button>
    <button (click)="newMajor()">最新主版</button>
    <app-child2 [major]="major" [minor]="minor"></app-child2>
  `
})
export class Parent2Component implements OnInit {
  major = 1;
  minor = 23;

  constructor() { }

  ngOnInit(): void {
  }

  newMinor() {
     this.minor++;
  }

  newMajor() {
    this.major++;
  }

}
